<%@page import="cn.jekun.component.pay.common.utils.WechatPayTools"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html; charset=UTF-8"%>
<%@ include file="/v1/pages/public/taglibs.jsp"%>
<%
    String code=request.getParameter("code");
	String state=request.getParameter("state");
%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>正在与微信支付连接中</title>
<meta name="viewport"
	content="width=device-width, initial-scale=1, user-scalable=0">
<link rel="stylesheet" href="${ctx}/v1/h5/css/jquery.mobile.ldh.structure.css">
<link rel="stylesheet" href="${ctx}/v1/h5/css/jquery.mobile.ldh.theme.css">
<link rel="stylesheet" href="${ctx}/v1/h5/css/jquery.mobile.ldh.css">
<script src="${ctx}/v1/h5/js/default/jquery-1.9.1.min.js"></script>
<script src="${ctx}/v1/h5/js/default/jquery.mobile.ldh.js"></script>

<script src="${ctx}/v1/h5/js/default/sea.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>

<script type="text/javascript">
	var ctx ="${ctx}";
    var url="<%=WechatPayTools.getUrl(request)%>";
	var ctx ="${ctx}";
	var code="<%=code%>";
	var state="<%=state%>";
	state=decodeURI(state);
	var params=state.split(",");
	var orderId=params[0];
	
	var orderAmount=params[1];
	
 	seajs.use([ctx+'/v1/h5/js/custom/order/module-pay.js'],function(m){
			m.init(m);
			//console.log("code:"+code+";"+"url:"+url+";"+"orderId:"+orderId+";"+"orderAmount:"+orderAmount);			
			m.goWxPay(code,url,orderId,orderAmount);
			//alert("code:"+code+"***"+"url:"+url+"***"+"orderId:"+orderId+"***"+"orderAmount:"+orderAmount+"***"+"m:"+m);
		});
	 
	 
	</script>
</head>



<body>
	<div class="wxapi_container">正在与微信支付连接中...</div><br>
	 <!-- <input type="text" id="appid" value="" size="500"/><br>
	  <input type="text" id="timestamp" value="" size="500"/><br>
	  <input type="text" id="noncestr" value="" size="500"/><br>
	   <input type="text" id="url" value="" size="500"/><br>
	  <input type="text" id="signature" value="" size="500"/><br>
	   <input type="text" id="signature_server" value="" size="500"/>
	 <form action="http://www.jujie.xyz/mall/shopapp/WebPay/payByWXPay.do" method="get">
	   <input type="text" name="code" value="<%=code%>"/>
	   <input type="text" name="terminalId"/>
	   <input type="text" name="userId" value="201406262325401643"/>
	   <input type="text" name="orderId" value="201503301753384668"/>
	   <input type="text" name="orderTime"/>
	    <input type="text" name="orderAmount" value="0.01"/>
	     <input type="text" name="channelCode" value="01"/>
	 <input type="submit"value="提交"/>
	</form> -->
   <script type="text/javascript">
  
   
   var url=window.location.href;
  
   
   //var params=url.split("?")[1];
   
   //var code=params.split("&")[0].split("=")[1];
   
   //window.location.href="https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code"
   //alert(url);
  </script>
</body>
</html>


